import React, { Component } from 'react'
import { Route, Switch,Redirect } from "react-router-dom";
import MyLink from "../../compontents/MyLink";
import Message from './Meaasge'
import News from './News'
export default class index extends Component {
    render() {
        // console.log('home组件传值',this.props)
        return (
            <div>
              <h3>我是home的内容</h3>
              <div>
              <ul className="nav nav-tabs">
                  <li>
                  <MyLink to="/home/news">News</MyLink>
                  </li>
                  <li>
                  <MyLink to="/home/message">Message</MyLink>
                  </li>
                </ul>
                {/* 注册路由 */}
               <Switch>
                <Route path="/home/news" component={News}></Route>
                <Route path="/home/message" component={Message}></Route>
                <Redirect to="/home/news"></Redirect>
                </Switch>
              </div>
            </div>
        )
    }
}
